ActiveReports 8
Add Hyperlinks
Show AllShow All
Hide AllHide All

In a section report, you can add hyperlinks in a report using the Hyperlink property available with the following controls:

You can add hyperlinks that connect to a Web page, open an e-mail, or jump to a bookmark.

Note: Specify the full URL address (for example, "http://www.grapecity.com") for the Hyperlink property to avoid broken links while viewing reports.

To link to a Web page

  1. Select an existing control or drag and drop a control from the Visual Studio toolbox onto the design surface.
  2. Right-click the control to open the Properties Window.
  3. In the Properties Window, set the HyperLink property to any valid URL. For example, for example, http://www.grapecity.com.

To link to an e-mail address

  1. Select an existing control or drag and drop a control from the Visual Studio toolbox onto the design surface.
  2. Right-click the control to open the Properties Window.
  3. In the Properties Window, set the HyperLink property to mailto: any valid e-mail address.

To parse the URL out of a database field for a hyperlink

  1. From the Report Explorer, drag and drop the link field onto the design surface.
  2. Double-click the section where you had placed the link field. This creates an event-handling method for the section's Format event.
  3. Add code to the Format event to,
    • Parse the URL out of the Link field
    • Assign it to the HyperLink property of TextBox
    • Remove the URL markers from the text displayed in TextBox

The following example shows what the code for the method looks like.

To write the code in Visual Basic.NET

To write the code in C#

To create a hyperlink that jumps to a bookmark

  1. From the Report Explorer, drag and drop a field onto the design surface.
  2. Double-click the section where you had placed the field. This creates an event-handling method for the section's Format event.
  3. Add the following code inside the Format event.

The following example shows what the code for the method looks like.

To write the code in Visual Basic.NET

To write the code in C#

To display the page number of the bookmark in the table of contents

  1. Select the gray area outside the report and right-click to choose Properties option from the context menu. 
  2. In the Properties Window that appears, click the Events button to get the list of events for the report.
  3. Select the FetchData event from that list and double-click it. This creates an event-handling method for the report's FetchData event in the code behind.
  4. Add code to the handler to retrieve information to populate the report fields.

The following example shows what the code for the method looks like.

To write the code in Visual Basic

To write the code in C#

See Also

Concepts

Support Forum